Send feedback on this topic.
Teradata.Client.Provider
ReadAsync(Byte[],Int32,Int32,CancellationToken) Method



Teradata.Client.Provider Namespace > TdStream Class > ReadAsync Method : ReadAsync(Byte[],Int32,Int32,CancellationToken) Method
Specifies a Byte array to read data into.
Specifies the location within the buffer to read data into.
Specifies the number of bytes to read into the buffer
A Threading.CancellationToken used to indicate that the asynchronous operation should be canceled.
Reads data into the application provided buffer asynchronously and advances the current position of the stream.
Syntax
'Declaration
 
Public Overloads Overrides NotOverridable Function ReadAsync( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer, _
   ByVal cancellationToken As CancellationToken _
) As Task(Of Integer)
'Usage
 
Dim instance As TdStream
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim cancellationToken As CancellationToken
Dim value As Task(Of Integer)
 
value = instance.ReadAsync(buffer, offset, count, cancellationToken)
public override Task<int> ReadAsync( 
   byte[] buffer,
   int offset,
   int count,
   CancellationToken cancellationToken
)
public:
Task<int>^ ReadAsync( 
   array<byte>^ buffer,
   int offset,
   int count,
   CancellationToken cancellationToken
) override 

Parameters

buffer
Specifies a Byte array to read data into.
offset
Specifies the location within the buffer to read data into.
count
Specifies the number of bytes to read into the buffer
cancellationToken
A Threading.CancellationToken used to indicate that the asynchronous operation should be canceled.

Return Value

Returns the number of bytes read from the Advanced SQL Engine and written into the buffer. The number will be equal or less than count.
Exceptions
ExceptionDescription
buffer is null.

count or offset is negative or the sum of offset and count is larger than the buffer length.

The TdConnection is closed.
The TdStream is closed / dispose.
The SQL Engine returned an error, or the .NET Data Provider for Teradata detected an error.
Remarks
The .NET Data Provider for Teradata reads the LOB from Teradata and transfers it to the application provided buffer.
Requirements
ProductVersionsPlatforms
.NET2.1, 3.1, 6Windows, Linux, MacOS
.NET Framework4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8Windows
.NET Standard2.0Windows, Linux, MacOS
See Also

Reference

TdStream Class
TdStream Members
Overload List